package com.rmfyzxfw.caseprocess.model.dynamic.query;

import com.rmfyzxfw.caseprocess.model.dynamic.condition.DynamicCondition;
import com.rmfyzxfw.caseprocess.model.param.PageBaseParam;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class DynamicFormDataQuery extends PageBaseParam {


    /**
     * 表名
     */
    private String tableName;
    /**
     * 查询字段
     */
    private List<String> selectFields;
    /**
     * id条件
     */
    private List<Long> ids;
    /**
     * 查询条件
     */
    private List<DynamicCondition> searchFields;

    /**
     * 排序规则 默认降序
     */
    private SortCondition sortCondition;

    /**
     * 驼峰 默认true
     */
    private Boolean camelCase = true;

    public Long getOffset() {
        return (getPageNum()-1) * getPageSize();
    }

}
